package com.cn.algorithm02.class03;

/***
 * @author: hels
 * @description:
 * 1 数组中仅有1个数字个数为奇数，find
 * 2 字符串s仅有数字和字母组成，t增加了一个字符，找到多余得字符
 **/
public class C02_OddChar {
    public static void main(String[] args) {
        // ques1
        int[] arr = {1,1,2,2,3};
        int eor = 0;
        for (int i = 0; i < arr.length; i++) {
            eor ^= arr[i];
        }
        System.out.println(eor);

        // ques2
        String s = "d342";
        String t = "kd342";
        char c = t.charAt(t.length() - 1);
        for (int i = 0; i < s.length(); i++) {
            c ^= (t.charAt(i) ^ s.charAt(i));
        }
        System.out.println(c);

    }

}
